

package com.gavin.lingxi.rtclib;

import org.webrtc.IceCandidate;
import org.webrtc.PeerConnection;
import org.webrtc.SessionDescription;

import java.util.List;

/**
 * AppRTCClient is the interface representing an AppRTC client.
 */
public interface IAppRTCClient {

    int AUDIO_INIT_ERROR = 100;

    public void connectToFriend(final boolean chatInitationFlag);
    /**
     * Struct holding the signaling parameters of an AppRTC room.
     */

    public static class SignalingParameters {
        public final List<PeerConnection.IceServer> iceServers;
        public final boolean initiator;
//    public final SessionDescription offerSdp;
//    public final List<IceCandidate> iceCandidates;

        public SignalingParameters(
                List<PeerConnection.IceServer> iceServers, boolean initiator/*,
            SessionDescription offerSdp, List<IceCandidate> iceCandidates*/) {
            this.iceServers = iceServers;
            this.initiator = initiator;
//      this.offerSdp = offerSdp;
//      this.iceCandidates = iceCandidates;
        }
    }

    /**
     * Callback interface for messages delivered on signaling channel.
     * <p>
     * <p>Methods are guaranteed to be invoked on the UI thread of |activity|.
     */
    public static interface SignalingEvents {

        public void onConnectedToFriend(final SignalingParameters params);

        /**
         * Callback fired once remote SDP is received.
         */
        public void onRemoteDescription(final SessionDescription sdp);

        /**
         * Callback fired once remote Ice candidate is received.
         */
        public void onRemoteIceCandidate(final IceCandidate candidate);

        /**
         * Callback fired once channel is closed.
         */
        public void onChannelClose();
    }
}
